<html>
<head><meta charset="utf-8"><title>Closure substitution in tests · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Closure.20substitution.20in.20tests.html">Closure substitution in tests</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="222855434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Closure%20substitution%20in%20tests/near/222855434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Closure.20substitution.20in.20tests.html#222855434">(Jan 15 2021 at 13:17)</a>:</h4>
<p>We currently don't have an way of testing closure substitutions like these:</p>
<div class="codehilite"><pre><span></span><code>Implemented({closure:ClosureId(0)}&lt;for&lt;0&gt; Safe () [?0 := Uint(U32), ?1 := ^1.0]&gt;: Send)
</code></pre></div>
<p>(context: <a href="https://github.com/rust-lang/chalk/issues/614">chalk#614</a>)</p>



<a name="222855649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Closure%20substitution%20in%20tests/near/222855649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> detrumi <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Closure.20substitution.20in.20tests.html#222855649">(Jan 15 2021 at 13:19)</a>:</h4>
<p>Should we add something like <code>ClosureSubst(closure, fnPointer)</code>? Or allow <code>closure(fnPointer)</code> instead, if we can get that to work with the number of parameters?</p>



<a name="222890836"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Closure%20substitution%20in%20tests/near/222890836" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Closure.20substitution.20in.20tests.html#222890836">(Jan 15 2021 at 17:12)</a>:</h4>
<p>I think the closure substs in general need to be added. <span class="user-mention" data-user-id="125294">@Aaron Hill</span> said they were going to get to it, but didn't get around to it</p>



<a name="222890865"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/Closure%20substitution%20in%20tests/near/222890865" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jack Huey <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/Closure.20substitution.20in.20tests.html#222890865">(Jan 15 2021 at 17:13)</a>:</h4>
<p>They're needed for rustc lowering</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>